<template>
	<view>
		<view class="header flex">
			<text>设置分享状态</text>
			<view class="right flex">
				<picker @change="Change" :value="index" :range="array">
					<view class="right-value">{{array[index]}}</view>
				</picker>
				<image :src="imgurl+'youjiantou.png'"></image>
			</view>
		</view>
		<view class="title">该状态下凭借密码可以进入查看</view>
		<view class="pass" v-if="showpass">
			<text>设置密码</text>
			<input @input="getPass" placeholder="长度为8-20,包含字母和数字" placeholder-class="place" />
			<view class="bottom flex">
				<checkbox color="#209FFC" style="transform: scale(0.7);"></checkbox>
				<text>可修改备注</text>
			</view>
		</view>
		<button class="buttoncss" @tap="Save">{{buttontitle}}</button>
	</view>
</template>

<script>
	import app from "../../../App.vue"
	export default {
		data() {
			return {
				imgurl: '',
				array: ['不公开', '密码公开'],
				index: 0,
				buttontitle: '保存',
				pass: "",
				showpass: false
			};
		},
		methods: {
			Change(e) {
				let that = this
				this.index = e.target.value
				if (e.target.value == 0) {
					that.showpass = false
					that.buttontitle = '保存'
				}
				if (e.target.value == 1) {
					that.showpass = true
					that.buttontitle = '保存并获取分享链接'
				}
			},
			//密码
			getPass(e) {
				console.log(e.detail.value)
			},
			Save() {
				// uni.showModal({
				//     content: '提示:此功能仅对企业版用户开放!',
				// 	showCancel:false,
				// 	confirmText:'知道了',
				// 	confirmColor:'#00A0E9',
				//     success: function (res) {
				//         if (res.confirm) {
				//             console.log('用户点击确定');
				//         } else if (res.cancel) {
				//             console.log('用户点击取消');
				//         }
				//     }
				// });
			}
		},
		onLoad() {
			this.imgurl = app.globalData.imgurls
			let that = this
			// uni.getSystemInfo({
			// 	success: function(res) {
			// 		that.height = res.windowHeight * 0.85 + 'px'
			// 		that.width = res.windowWidth + 'px'
			// 	}
			// });
		}
	}
</script>

<style lang="scss">
	.header {
		justify-content: space-between;
		width: 690rpx;
		height: 100rpx;
		margin: 20rpx auto;
		border-bottom: 1rpx solid #DFDFDF;

		.right {
			.right-value {
				width: 400rpx;
				text-align: right;
			}

			image {
				width: 50rpx;
				height: 50rpx;
			}
		}
	}

	.title {
		color: #999;
		width: 690rpx;
		margin: 0 auto;
		font-size: 30rpx;
		height: 60rpx;
		line-height: 60rpx;
	}

	.pass {
		color: #333;
		font-size: 30rpx;
		width: 690rpx;
		margin: 100rpx auto 80rpx;

		input {
			border: 1rpx solid #DFDFDF;
			width: 80%;
			padding-left: 20rpx;
			height: 70rpx;
			line-height: 70rpx;
			margin: 10rpx 0;
		}

		.bottom {
			height: 100rpx;
			line-height: 100rpx;
		}
	}

	.place {
		color: #999;
		font-size: 24rpx;
	}

	.buttoncss {
		width: 690rpx;
		margin: 50rpx auto 0;
		height: 100rpx;
		line-height: 100rpx;
		background: #209FFC;
		border-radius: 50rpx;
		text-align: center;
		color: #fff;
		font-size: 36rpx;
	}

	.lianjie {
		width: 690rpx;
		margin: 10% auto 0;
		color: #333;
		font-size: 30rpx;

		input {
			height: 60rpx;
			line-height: 60rpx;
			width: 100%;
			margin: 20rpx 0;
		}

		.copy {
			width: 350rpx;
			height: 100rpx;
			line-height: 100rpx;
			margin: 0 auto;
			background: #209FFC;
			border-radius: 50rpx;
			text-align: center;
			color: #fff;
			font-size: 30rpx;
		}
	}
</style>
